package com.lyj.system.controller.user;

import com.lyj.common.core.controller.BaseController;
import com.lyj.common.core.domain.R;
import com.lyj.common.core.domain.TableDataInfo;
import com.lyj.system.domain.user.dto.UserDTO;
import com.lyj.system.domain.user.dto.UserQueryDTO;
import com.lyj.system.service.user.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2025-08-23
 * Time: 11:20
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController extends BaseController {
    @Resource(name = "userServiceImpl")
    private UserService userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQueryDTO) {
        return getTableDataInfo(userService.list(userQueryDTO));
    }
    @PutMapping("/updateStatus")
    //todo 拉黑：限制用户操作   解禁：放开对于用户限制
    //更新数据库中用户的状态信息。
    public R<Void> updateStatus(@RequestBody UserDTO userDTO) {
        return toR(userService.updateStatus(userDTO));
    }
}
